#pragma once
#include "../stdafx.h"
#include "Tmp_Manager.h"
//#include "Figure.h"
#include  "../modelheaders.h"
#include "../math/math.h"
#include <vector>
using namespace std;
	typedef struct _ANIMATION
	{
		int32 id;
		int32 fid;
		char* name;
		int32 anim;
		D3DXVECTOR3* vertices;
	}ANIMATION;
	
	class ModelManager;
	class FigureManager;
	class TextureManager;
	class AnimManager : public Manager<ANIMATION> , public Component
	{
	public:
		AnimManager(ModelManager*,FigureManager*,TextureManager*);
		~AnimManager(void);
		void addedToObject();
		bool AddObj(int32,char *,int32);
		void CalcAnim(DWORD time);
		void CalcBones(Model* m,size_t anim, size_t time);
		bool ChangeAnim(int32,int32);
		void AnimatePreModel(Model* m,size_t anim,D3DXVECTOR3**,DWORD time);
		void Log();
		//bool InitMap(Map* map,Model* model,int32 anim);
		void RenderData();
		HRESULT CreateVetices();
		void RenderAnim(Message const & msg);
		void LoadAnim(Message const & msg);
		bool ChangeAABB(int32,Sphere);
		FigureManager* m_fManager;
		ModelManager* m_mManager;
		TextureManager* m_tManager;
	};